{extend name="base" /}
{block name="body"}
<div class="layui-card">
	<div class="layui-card-body">
		<form action="{:url('admin/push/record')}" class="layui-form" method="get">
			<div class="layui-form-item">
				<div class="layui-inline">
					搜索
				</div>
				<div class="layui-inline">
					<input type="text" name="name" value="{:input('name')}" autocomplete="off" placeholder="姓名/邮箱/手机号" class="layui-input"/>
				</div>
				<div class="layui-inline">
					机构
				</div>
				<div class="layui-inline">
					<select name="institute">
						<option value="">全部机构</option>
						{foreach name="institute" item="v"}
						<option value="{$v.institute}" {if condition="input('institute') eq $v.institute" }selected="selected"{/if}>{$v.institute}</option>
						{/foreach}
					</select>
				</div>
				<div class="layui-inline">
					职称
				</div>
				<div class="layui-inline">
					<select name="job_title">
						<option value="">全部职称</option>
						{foreach name="jobTitle" item="v"}
						<option value="{$v.job_title}" {if condition="input('job_title') eq $v.job_title" }selected="selected"{/if}>{$v.job_title}</option>
						{/foreach}
					</select>
				</div>
				<div class="layui-inline">
					创建时间
				</div>
				<div class="layui-inline">
					<input type="text" id="sendFrom" name="sendFrom" value="{:input('sendFrom')}" autocomplete="off" class="layui-input"/>
				</div>
				<div class="layui-inline">
					到
				</div>
				<div class="layui-inline">
					<input type="text" id="sendTo" name="sendTo" value="{:input('sendTo')}" autocomplete="off" class="layui-input"/>
				</div>
				<div class="layui-inline">
					<button class="layui-btn layui-btn-normal ajax-search"><i class="fa fa-search"></i></button>
				</div>
			</div>
		</form>
        <div class="layui-btn-group">
<!--		    <a href="{:url('admin/user/add')}" class="layui-btn"><i class="fa fa-plus-circle"></i> 添加会员</a>-->
        </div>
		<table class="layui-table layui-form">
			<thead>
				<tr>
					<th>姓名</th>
					<th>手机号</th>
					<th>邮箱</th>
					<th>发送时间</th>
					<th>消息内容</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				{foreach name="list" item="v" empty="$empty"}
				<tr>
					<td>{$v.user_name}</td>
					<td>{$v.phone}</td>
					<td>{$v.email}</td>
					<td>{$v.send_time}</td>
					<td>{$v.content}</td>
					<td>
						<a href="{:url('admin/push/rePush', ['id' => $v.id])}" class="layui-btn layui-btn-xs layui-btn-normal ajax-action"><i class="fa fa-edit"></i> 重发</a>
					</td>
				</tr>
				{/foreach}
			</tbody>
		</table>
		<div class="page">{$list->render()}</div>
	</div>
</div>
{/block}
{block name="js"}
<script>
	laydate.render({
		elem: '#sendFrom',
		type: 'date'
	})
	laydate.render({
		elem: '#sendTo',
		type: 'date'
	})
</script>
{/block}